package vn.wallet.app.domain;

// Generated Nov 15, 2012 12:09:27 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * User generated by hbm2java
 */
@Entity
@Table(name = "user", catalog = "wallet")
public class User implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private Currency currency;
	private String title;
	private String username;
	private String password;
	private String email;
	private boolean emailConfirm;
	private String param;
	private Date registerDate;
	private String ipRegistration;
	private Date lastvisitDate;
	private String ipLogined;
	private boolean status;
	private Set<Profile> profiles = new HashSet<Profile>(0);
	private Set<Category> categories = new HashSet<Category>(0);
	private Set<Payment> payments = new HashSet<Payment>(0);
	private Set<Budget> budgets = new HashSet<Budget>(0);

	public User() {
	}

	public User(Currency currency, String username, String password,
			String email, boolean emailConfirm, Date registerDate,
			String ipRegistration, boolean status) {
		this.currency = currency;
		this.username = username;
		this.password = password;
		this.email = email;
		this.emailConfirm = emailConfirm;
		this.registerDate = registerDate;
		this.ipRegistration = ipRegistration;
		this.status = status;
	}

	public User(Currency currency, String title, String username,
			String password, String email, boolean emailConfirm, String param,
			Date registerDate, String ipRegistration, Date lastvisitDate,
			String ipLogined, boolean status, Set<Profile> profiles,
			Set<Category> categories, Set<Payment> payments, Set<Budget> budgets) {
		this.currency = currency;
		this.title = title;
		this.username = username;
		this.password = password;
		this.email = email;
		this.emailConfirm = emailConfirm;
		this.param = param;
		this.registerDate = registerDate;
		this.ipRegistration = ipRegistration;
		this.lastvisitDate = lastvisitDate;
		this.ipLogined = ipLogined;
		this.status = status;
		this.profiles = profiles;
		this.categories = categories;
		this.payments = payments;
		this.budgets = budgets;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "currency_prefer", nullable = false)
	public Currency getCurrency() {
		return this.currency;
	}

	public void setCurrency(Currency currency) {
		this.currency = currency;
	}

	@Column(name = "title", length = 10)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "username", nullable = false, length = 100)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "password", nullable = false)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "email", nullable = false)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "email_confirm", nullable = false)
	public boolean isEmailConfirm() {
		return this.emailConfirm;
	}

	public void setEmailConfirm(boolean emailConfirm) {
		this.emailConfirm = emailConfirm;
	}

	@Column(name = "param")
	public String getParam() {
		return this.param;
	}

	public void setParam(String param) {
		this.param = param;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "registerDate", nullable = false, length = 19)
	public Date getRegisterDate() {
		return this.registerDate;
	}

	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}

	@Column(name = "ip_registration", nullable = false, length = 20)
	public String getIpRegistration() {
		return this.ipRegistration;
	}

	public void setIpRegistration(String ipRegistration) {
		this.ipRegistration = ipRegistration;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "lastvisitDate", length = 19)
	public Date getLastvisitDate() {
		return this.lastvisitDate;
	}

	public void setLastvisitDate(Date lastvisitDate) {
		this.lastvisitDate = lastvisitDate;
	}

	@Column(name = "ip_logined", length = 20)
	public String getIpLogined() {
		return this.ipLogined;
	}

	public void setIpLogined(String ipLogined) {
		this.ipLogined = ipLogined;
	}

	@Column(name = "status", nullable = false)
	public boolean isStatus() {
		return this.status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Profile> getProfiles() {
		return this.profiles;
	}

	public void setProfiles(Set<Profile> profiles) {
		this.profiles = profiles;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Category> getCategories() {
		return this.categories;
	}

	public void setCategories(Set<Category> categories) {
		this.categories = categories;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Payment> getPayments() {
		return this.payments;
	}

	public void setPayments(Set<Payment> payments) {
		this.payments = payments;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Budget> getBudgets() {
		return this.budgets;
	}

	public void setBudgets(Set<Budget> budgets) {
		this.budgets = budgets;
	}

}
